package com.oxygen.design.iterator;

import com.oxygen.design.iterator.interfaces.Iterator;
import com.oxygen.design.iterator.interfaces.impl.NameRepository;

/**
 * @author wangjie
 * @title: IteratorPatternDemo
 * @description: TODO
 * @date 2022/3/12 10:57 PM
 **/
public class IteratorPatternDemo {

    public static void main(String[] args) {
        NameRepository namesRepository = new NameRepository();

        for (Iterator iter = namesRepository.getIterator(); iter.hasNext(); ) {
            String name = (String) iter.next();
            System.out.println("Name : " + name);
        }
    }

}
